home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / datatypes / sun.datatype / sun.datatype.install < prev    next >
Text File  |  1996-04-07  |  4KB  |  141 lines

  1. ; SUN Datatype Installer Script
  2. ; $VER: sun.datatype.install 39.6 (22.1.95)
  3. ;
  4.  
  5. ; First make sure we have WB3.0
  6. (set @default-dest "")
  7. (if (< (/ (getversion) 65536) 39)
  8. (
  9.   (abort "You must have at least Workbench 3.0")
  10. ))
  11.  
  12. ; Now check for at least a 68020 processor
  13. (set proc (database "cpu"))
  14.  
  15. (set cpu (askchoice
  16.   (prompt "Which version do you want to install ?")
  17.   (choices "68000" "68020")
  18.   (if (OR (= proc "68000") (= proc "68010"))
  19.     (default 0)
  20.     (default 1)
  21.   )
  22.   (help
  23.     (cat "On machines with an 68020 processor or higher, like "
  24.          "the Amiga 1200, 2500, 3000 and 4000 you can select "
  25.          "the 68020 version, which is optimized for those "
  26.          "processors.\n\n"
  27.          "If you have an Amiga with a 68000 or 68010 processor, "
  28.          "like the standard version of the Amiga 500, 500+, "
  29.          "600, 2000 and you have upgraded to Kickstart 3.0 or "
  30.          "higher, then you must select the 68000 version."))
  31. ))
  32.  
  33. ; Check that the datatypes directory exists
  34. (if (NOT (exists "SYS:classes/datatypes"))
  35. (
  36.   (abort "Can't find the SYS:classes/datatypes directory")
  37. ))
  38.  
  39. ; Copy the datatype to it
  40. (copylib
  41.   (prompt "")
  42.   (help @copyfiles-help)
  43.   (if (= cpu 0)
  44.     (source "Classes/DataTypes/sun.datatype.68000")
  45.     (source "Classes/DataTypes/sun.datatype.68020")
  46.   )
  47.   (dest "SYS:classes/datatypes")
  48.   (newname "sun.datatype")
  49.   (confirm)
  50. )
  51.  
  52. ; Find out what sort of installation this is
  53. (set choice (askchoice
  54.   (prompt "Install as permanently enabled, or manually selectable")
  55.   (choices "Permanently enabled" "Manual select")
  56.   (help
  57.     (cat "The datatype can be installed as permanently enabled, or"
  58.          " manually selectable.\n\n"
  59.          "Pemanently enabled means that the datatype is always ready for use.\n\n"
  60.          "Manually Selectable means that the datatype has to be\n"
  61.          "run before it can be used. Once it has been run, it\n"
  62.          "remains installed until the computer is rebooted."))
  63. ))
  64.  
  65. (if (= choice 0)
  66. (
  67.   ; Permanent installation
  68.   ; Check that the datatypes directory exists
  69.   (if (NOT (exists "DEVS:datatypes"))
  70.   (
  71.     (abort "Can't find the DEVS:datatypes directory")
  72.   ))
  73.  
  74.   (if (NOT (exists "DEVS:DataTypes/Sun Raster"))
  75.   (
  76.     ; Copy the datatype to it
  77.     (copyfiles
  78.       (prompt "")
  79.       (help @copyfiles-help)
  80.       (source "Sun Raster")
  81.       (infos)
  82.       (dest "DEVS:datatypes")
  83.     )
  84.   ))
  85. )
  86. (
  87.   ; Manual installation
  88.   ; Check that the storage directory exists
  89.   (if (NOT (exists "SYS:Storage/datatypes"))
  90.   (
  91.     (abort "Can't find the SYS:Storage/Datatypes directory")
  92.   ))
  93.  
  94.   (if (NOT (exists "SYS:Storage/DataTypes/Sun Raster"))
  95.   (
  96.     ; Copy the datatype to it
  97.     (copyfiles
  98.       (prompt "")
  99.       (help @copyfiles-help)
  100.       (source "Sun Raster")
  101.       (infos)
  102.       (dest "SYS:Storage/Datatypes")
  103.     )
  104.   ))
  105. ))
  106.  
  107. ; Delete the old versions of the datatype description, if available
  108. (if (exists "DEVS:datatypes/SUN")
  109. (
  110.   (delete "DEVS:datatypes/SUN")
  111. ))
  112. (if (exists "DEVS:datatypes/SUN.info")
  113. (
  114.   (delete "DEVS:datatypes/SUN.info")
  115. ))
  116. (if (exists "SYS:Storage/datatypes/SUN")
  117. (
  118.   (delete "SYS:Storage/datatypes/SUN")
  119. ))
  120. (if (exists "SYS:Storage/datatypes/SUN.info")
  121. (
  122.   (delete "SYS:Storage/datatypes/SUN.info")
  123. ))
  124.  
  125. ; Now exit, telling them what the situation is
  126. (if (= choice 0)
  127. (
  128.   ; Installation was permanent
  129.   (exit
  130.     (cat "You will have to reboot the system before you can use the "
  131.          "Sun datatype."
  132.   ))
  133. )
  134. (
  135.   ; Installation was manual
  136.   (exit
  137.     (cat "You must double-click on the Sun Raster icon in the Storage->Datatypes "
  138.          "drawer on your Workbench disk in order to use the Sun datatype. "
  139.          "The datatype will then be available for use until you reboot."
  140.   ))
  141. ))